package org.example.enums;

/**
 * 文件上传类型枚举
 * @author hanxi
 */
public enum FileUploadTypeEnum {

    HEAD(1, "head/","头像"),SYSTEM_PIC(2,"system/","系统图片"),
    VIDEO(3,"video/","视频"),DOMAIN_CERT(4,"domain/cert/","域名证书");

    private int id;

    private String prefix;

    private String name;

    FileUploadTypeEnum(int id, String prefix, String name) {
        this.id = id;
        this.prefix = prefix;
        this.name = name;
    }

    public static FileUploadTypeEnum getEnum(int id) {
        for (FileUploadTypeEnum resultCodeEnum : FileUploadTypeEnum.values()) {
            if (resultCodeEnum.getId()==id) {
                return resultCodeEnum;
            }
        }
        return null;
    }

    public int getId() {
        return id;
    }

    public String getPrefix() {
        return prefix;
    }

    public String getName() {
        return name;
    }

}
